// import 'ts-node/register';
// import { Observable } from "rxjs";
import { Observable, } from 'rxjs/Observable';
// import 'rxjs/add/operator/map';
import 'rxjs/add/observable/from';

let persons = [
    { name: 'David', age: 3, salary: 2000 },
    { name: 'Dav', age: 17, salary: 12000 },
    { name: 'Lomo', age: 20, salary: 16000 },
    { name: 'Dev', age: 20, salary: 10000 },
    { name: 'Amy', age: 7, salary: 34000 },
];

let index = 0;

Observable.from(persons).subscribe(
    person => {
        console.log(++index, person);
    },
    error => console.log(error),
    () => console.log('stream end/// ')
);

